<template>
  <div class="app">
    <div class="div-row">
      <el-row :gutter="40" class="panel-group">
        <el-col :xs="12" :sm="12" :lg="{span:'24-5'}" class="card-panel-col">
          <div class="card-panel" @click="handleSetLineChartData('1')">
            <div class="card-panel-icon-wrapper icon-people">
              <svg-icon icon-class="peoples" class-name="card-panel-icon"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                商品总授权金额/元
              </div>
              <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num"/>
            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="{span:'24-5'}" class="card-panel-col">
          <div class="card-panel" @click="handleSetLineChartData('2')">
            <div class="card-panel-icon-wrapper icon-message">
              <svg-icon icon-class="message" class-name="card-panel-icon"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                已支付费用/元
              </div>
              <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num"/>
            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="{span:'24-5'}" class="card-panel-col">
          <div class="card-panel" @click="handleSetLineChartData('3')">
            <div class="card-panel-icon-wrapper icon-money">
              <svg-icon icon-class="money" class-name="card-panel-icon"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                已退款费用/元
              </div>
              <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num"/>
            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="{span:'24-5'}" class="card-panel-col">
          <div class="card-panel" @click="handleSetLineChartData('4')">
            <div class="card-panel-icon-wrapper icon-shopping">
              <svg-icon icon-class="shopping" class-name="card-panel-icon"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                待支付费用/元
              </div>
              <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num"/>
            </div>
          </div>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="{span:'24-5'}" class="card-panel-col">
          <div class="card-panel" @click="handleSetLineChartData('5')">
            <div class="card-panel-icon-wrapper icon-shopping">
              <svg-icon icon-class="people" class-name="card-panel-icon"/>
            </div>
            <div class="card-panel-description">
              <div class="card-panel-text">
                扣款失败费用/元
              </div>
              <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num"/>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
    <div>
      <template>
        <el-select v-model="value" clearable placeholder="请选择订单状态">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>

        <el-select v-model="value" clearable placeholder="请选择商品扣款模式">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>

        <el-select v-model="value" clearable placeholder="请选择扣款方式">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>

        <el-select v-model="value" clearable placeholder="请选择看不清">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-input placeholder="请输入内容" v-model="value" style="width: 200px"/>
        <el-button icon="el-icon-search"></el-button>

        <el-select v-model="value" class="choice-option" clearable placeholder="请选择商品类型">
          <el-option
            v-for="item in [{
        value: '选项1',
        label: '全部'
      }]"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <div class="block">
          <el-date-picker
            v-model="value1"
            type="datetimerange"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :default-time="['12:00:00']"
          >
          </el-date-picker>
        </div>
        <el-button type="success">清除筛选</el-button>
        <el-button type="primary">下载所选订单信息</el-button>
        <el-button type="danger">下载全部订单信息</el-button>
      </template>
      <h2>次卡模式订单，只能通过商家端扫码进入核销</h2>
    </div>
    <div class="div-table">
      <el-table
        ref="multipleTable"
        :data="tableData"
        border
        stripe
        tooltip-effect="dark"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" align="center">
        </el-table-column>

        <el-table-column label="订单信息" align="center" prop="name">
        </el-table-column>

        <el-table-column label="信息" align="center" prop="address">
        </el-table-column>

        <el-table-column label="订单归属" align="center">
          <template v-slot="scope">
            <el-tag size="medium" type="warning">{{ scope.row.name }}</el-tag>
          </template>
        </el-table-column>

        <el-table-column label="商品信息" align="center" prop="address">
        </el-table-column>
        <el-table-column label="签约信息" align="center" prop="date">
        </el-table-column>
        <el-table-column label="期数信息" align="center" prop="date">
        </el-table-column>
        <el-table-column label="扣费信息（周月）" align="center" prop="date">
        </el-table-column>
        <el-table-column label="扣款信息（次卡）" align="center">
          <template>
            <span>无</span>
          </template>
        </el-table-column>
        <el-table-column label="备注" align="center">
          <template>
            <span>架子鼓</span>
          </template>
        </el-table-column>
        <el-table-column label="第一期账单" align="center">
          <template>
            <span>架子鼓</span>
          </template>
        </el-table-column>
        <el-table-column label="预约进度" align="center">
          <template v-slot="scope">
            <el-button type="success" size="mini">查看</el-button>
          </template>
        </el-table-column>
        <el-table-column label="状态" align="center">
          <template v-slot="scope">
            <el-tag size="medium">使用中</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template v-slot="scope">
            <el-button type="warning" size="mini">看不清</el-button>
            <el-button type="danger" size="mini" @click="deleteRow(scope.row.$index)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pagination">
      <el-pagination
        background
        layout="prev, pager, next"
        :total="1000"
        style="text-align: right"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import CountTo from 'vue-count-to'
import Index from '@/views/reservationCenter/reservationManagement/serviceReservationManagement/index.vue'

export default {
  components: {
    Index,
    CountTo
  },
  data() {
    const options = [
      {
        value: '选项1',
        label: '黄金糕'
      },
      {
        value: '选项2',
        label: '双皮奶'
      },
      {
        value: '选项3',
        label: '蚵仔煎'
      },
      {
        value: '选项4',
        label: '龙须面'
      },
      {
        value: '选项5',
        label: '北京烤鸭'
      }
    ]
    const tableData = [{
      date: '2016-05-02',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-04',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1517 弄'
    }, {
      date: '2016-05-01',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1519 弄'
    }, {
      date: '2016-05-03',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1516 弄'
    }]
    return {
      listLoading: true,
      dialogTableVisible: false,
      dialogFormVisible: false,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '120px',
      options,
      value: '',
      tableData
    }
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    },
    deleteRow(index) {
      this.tableData.splice(index, 1)
    }
  }
}
</script>

<style lang="scss" scoped>
.el-col-lg-24-5 {
  width: 20%;
}

.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 10px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 12px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
